package tests;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import constants.Maps;



import view.world.WorldPanel;

public class Truc extends JFrame implements ChangeListener, ActionListener {

	JSlider slider;
	JButton b;
	WorldPanel world;
	
	public Truc() {
		slider = new JSlider(0,10,5);
		b = new JButton("sdjlghsdfjklh");
		world = new WorldPanel(Maps.getMap("de_dust2"));
		
		JPanel gnah = new JPanel();
		
		b.setActionCommand("b");
		
		slider.addChangeListener(this);
		b.addActionListener(this);
		
		gnah.add(world);
		gnah.add(b);
		
		this.setContentPane(gnah);
		
	}
	
	
	public static void main(String[] args) {
		Truc frame = new Truc();
		frame.pack();
		frame.setVisible(true);
	}


	public void stateChanged(ChangeEvent arg0) {
		// TODO Auto-generated method stub
		System.out.println("CHANGED !!");
	}


	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		slider.setValue(2);
	}
}
